Ext.onReady(function() {
	var pstore = new Ext.data.JsonStore({
		autoDestroy: true,
		storeId: 'productStore',
		proxy: {
			type: 'ajax',
			url: 'data.js',
			reader: {
				type: 'json',
				root: 'result',
				idProperty: 'product'
			}
		},
		fields: ['proId', 'proName', 'factory', 'proDesc']
	});				 
	
	var grid = new Ext.grid.Panel({
		title : "产品列表",
		store:Ext.data.StoreManager.lookup('productStore'),
		columns : [ {
			header : "ID",
			dataIndex : "proID",
			width:200
		}, {
			header : "产品名称",
			dataIndex : "proName",
			width:200
		}, {
			header : "生产厂家",
			dataIndex : "factory",
			width:200
		}, {
			header : "产品描述",
			dataIndex : "proDesc",
			width:200
		} ]
	});
	
	new Ext.Viewport({layout:'fit',items:grid});
});